<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <button id="get">发送get请求</button>
</body>
<!-- 
  script做了那些事情：找到tool.js文件，并行执行tool.js里面的代码
 -->
<script src="http://localhost:3001/api/user/userinfo"></script>


<script>
  let getBtn = document.getElementById('get')
  getBtn.onclick = function () {
    myTools.ajax({
      type: 'get',
      url: 'http://localhost:3001/api/user/userinfo',
      data: {
        id: 1
      },
      success: function (data) {
        console.log(data);
      }
    })
  }
</script>

</html>